package com.base.library.adapter;

import android.content.Context;
import android.graphics.Rect;
import android.support.v7.widget.DividerItemDecoration;
import android.support.v7.widget.RecyclerView;
import android.view.View;

public class SpaceItemDecoration extends DividerItemDecoration {

    int mSpace;

    @Override

    public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
        super.getItemOffsets(outRect, view, parent, state);
        outRect.left = 0;
        outRect.right = 0;
        outRect.bottom = 0;
        outRect.top = mSpace;
    }

    public SpaceItemDecoration(Context context, int space) {
        super(context, HORIZONTAL);
        this.mSpace = space;
    }

    public SpaceItemDecoration(Context context) {
        super(context, HORIZONTAL);
        this.mSpace = 20;
    }
}